home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / c / librarytest.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-12  |  1.2 KB  |  58 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: librarytest.c,v 1.3 1996/09/12 14:48:55 digulla Exp $
  4.     $Log: librarytest.c,v $
  5.     Revision 1.3  1996/09/12 14:48:55  digulla
  6.     Tests why it didnĀ“t work
  7.  
  8.     Revision 1.2  1996/08/01 17:40:44  digulla
  9.     Added standard header for all files
  10.  
  11.     Desc:
  12.     Lang:
  13. */
  14. #include <clib/exec_protos.h>
  15. #include <clib/dos_protos.h>
  16. #include <clib/aros_protos.h>
  17. #include "dummylib_gcc.h"
  18.  
  19. CALLENTRY /* Before the first symbol */
  20.  
  21. struct ExecBase *SysBase;
  22. struct DosLibrary *DOSBase;
  23.  
  24. LONG entry(struct ExecBase *sysbase)
  25. {
  26.     SysBase=sysbase;
  27.  
  28.     DOSBase=(struct DosLibrary *)OpenLibrary("dos.library",39);
  29.  
  30.     if(DOSBase!=NULL)
  31.     {
  32.     int a=1,b=2,c=0,d=0;
  33.     struct dummybase *dummybase;
  34.  
  35.     dummybase=(struct dummybase *)OpenLibrary("dummy.library",0);
  36.  
  37.     if(dummybase!=NULL)
  38.     {
  39.         ULONG vec[3];
  40.         c=add(a,b);
  41.         d=asl(a,b);
  42.         vec[0]=a;
  43.         vec[1]=b;
  44.         vec[2]=c;
  45.         VPrintf("%ld+%ld=%ld\n",vec);
  46.         vec[0]=a;
  47.         vec[1]=b;
  48.         vec[2]=d;
  49.         VPrintf("%ld<<%ld=%ld\n",vec);
  50.         Flush (Output ());
  51.  
  52.         CloseLibrary((struct Library *)dummybase);
  53.     }
  54.     CloseLibrary((struct Library *)DOSBase);
  55.     }
  56.     return 0;
  57. }
  58.